using System.Collections;
using System.Collections.Generic;
using MyFrame.Mono;
using Platform.Skill.Deployer;
using UnityEngine;
using UnityEngine.Events;

namespace GardeningSkeleton.Platform.SkillSpace
{
    public abstract class BaseImpactEffect : IImpactEffect
    {
        public SkillData skillData;

        public abstract void EndEffect();

        public abstract void Execute(SkillDeployer baseDeployer);

        public virtual void OnImpactTriggerEntry(Collider2D other){}
        public virtual void OnImpactTriggerExit(Collider2D other){}

        void AddUpdateEvent(UnityAction action)
        {
            MonoMgr.Instance.AddUpdateEvent(action);
        }

        void RemoveUpdateEvent(UnityAction action)
        {
            MonoMgr.Instance.RemoveUpdateEvent(action);
        }


        #region 简写
        public Entity OwnerEntity => skillData.owner.GetComponent<Entity>();
        public Vector3 OwnerPos => skillData.owner.transform.position;
        public float OwnerDamage => OwnerEntity.stats.damage.Value;
        #endregion
    }
}